package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) FileCategoryCreate(ctx context.Context, req *system.FileCategoryCreateReq) (res *system.FileCategoryCreateRes, err error) {
	res = new(system.FileCategoryCreateRes)
	res.Id, err = service.File().AddAttachmentCategory(ctx, model.FileCategoryAddInput{
		ParentId: req.ParentId,
		Name:     req.Name,
	})
	return
}
